import { instance } from "../utils/request";
const getInfosPagination = async (page:number,limit:number,key?:string) => {
	return await instance.get("/Infos/Pagination", {page,limit,key});
};

const addInfos = async (data:RequestCreateInfosDto) => {
	return await instance.post("/Infos/Add", data);
};

const updateInfos = async (data:RequestUpdateInfosDto) => {
	return await instance.post("/Infos/Update", data);
};

const getInfosDetail = async (id:number) => {
	return await instance.get("/Infos/Detail", { id  });
};

const deleteInfos = async (data:RequestIdInfosDto) => {
	return await instance.post("/Infos/Delete", data);
};

const InfosApi = {
	getInfosPagination,
	addInfos,
	updateInfos,
	getInfosDetail,
	deleteInfos,
};

export default InfosApi
